﻿<div>
    <MudChart ChartType="ChartType.Line" ChartSeries="@Series" @bind-SelectedIndex="_index" XAxisLabels="@XAxisLabels" Width="100%" Height="350px"></MudChart>
    <MudText Typo="Typo.h6">Selected portion of the chart: @_index</MudText>
</div>

@code {
    public static string __description__ = "Clicking the chart series or legend should update the index.";
    
    private int _index = -1; //default value cannot be 0 -> first selectedindex is 0.

    public List<ChartSeries> Series =
    [
        new() { Name = "Series 1", Data = [90, 79, 72, 69, 62, 62, 55, 65, 70] },
        new() { Name = "Series 2", Data = [10, 41, 35, 51, 49, 62, 69, 91, 148] }
    ];

    public string[] XAxisLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep"];
}
